// ==========================================================================
// gin-sns auto gen code.
// date：2021-02-21 13:45:54 +0800 CST
// path: app/model/module/comment/comment_entity.go
// author：jon
// ==========================================================================

package comment

import (
	"time"
)

// 数据表映射结构体
type Entity struct {
	Id            int64     `json:"id" xorm:"not null pk autoincr comment('') bigint(20)"`
	UserId        int64     `json:"user_id" xorm:"comment('用户id') bigint(20)"`
	EntityType    int       `json:"entity_type" xorm:"comment('实体类型') int(11)"`
	EntityId      int64     `json:"entity_id" xorm:"comment('实体id') bigint(20)"`
	Content       string    `json:"content" xorm:"comment('内容') text"`
	QuoteId       int64     `json:"quote_id" xorm:"comment('引用的comment的id') bigint(20)"`
	CountLike     int64     `json:"count_like" xorm:"comment('赞同数量') bigint(20)"`
	CountUnlike   int64     `json:"count_unlike" xorm:"comment('反对数量') bigint(20)"`
	CountComments int64     `json:"count_comments" xorm:"comment('评论数量') bigint(20)"`
	Status        int       `json:"status" xorm:"comment('0未审核 1正常状态 2审核未通过 3删除') tinyint(2)"`
	CreateTime    time.Time `json:"create_time" xorm:"comment('创建时间') datetime"`
	UpdateTime    time.Time `json:"update_time" xorm:"comment('更新时间') datetime"`
}

//新增页面请求参数
type AddReq struct {
	UserId        int64  `form:"userId" `
	EntityType    int    `form:"entityType" `
	EntityId      int64  `form:"entityId" `
	Content       string `form:"content" `
	QuoteId       int64  `form:"quoteId" `
	CountLike     int64  `form:"countLike" `
	CountUnlike   int64  `form:"countUnlike" `
	CountComments int64  `form:"countComments" `
	Status        int    `form:"status" binding:"required"`
}

// 发表评论
type CreateCommentReq struct {
	EntityType int    `form:"entityType"`
	EntityId   int64  `form:"entityId"`
	Content    string `form:"content"`
	QuoteId    int64  `form:"quoteId"`
}

//修改页面请求参数
type EditReq struct {
	Id            int64  `form:"id" binding:"required"`
	UserId        int64  `form:"userId" `
	EntityType    int    `form:"entityType" `
	EntityId      int64  `form:"entityId" `
	Content       string `form:"content" `
	QuoteId       int64  `form:"quoteId" `
	CountLike     int64  `form:"countLike" `
	CountUnlike   int64  `form:"countUnlike" `
	CountComments int64  `form:"countComments" `
	Status        int    `form:"status" binding:"required不能为空"`
}

//分页请求参数
type SelectPageReq struct {
	UserId        int64  `form:"userId"`        //用户id
	EntityType    int    `form:"entityType"`    //实体类型
	EntityId      int64  `form:"entityId"`      //实体id
	Content       string `form:"content"`       //内容
	QuoteId       int64  `form:"quoteId"`       //引用的comment的id
	CountLike     int64  `form:"countLike"`     //赞同数量
	CountUnlike   int64  `form:"countUnlike"`   //反对数量
	CountComments int64  `form:"countComments"` //评论数量
	Status        int    `form:"status"`        //0未审核 1正常状态 2审核未通过 3删除
	BeginTime     string `form:"beginTime"`     //开始时间
	EndTime       string `form:"endTime"`       //结束时间
	PageNum       int    `form:"pageNum"`       //当前页码
	PageSize      int    `form:"pageSize"`      //每页数
}
